package cn.zyq.demo.service.wx;

import cn.zyq.demo.beans.sys.SysAdmin;
import cn.zyq.demo.beans.wx.WxPayLog;
import cn.zyq.demo.system.common.PageParam;
import cn.zyq.demo.system.enums.WxPayModuleTypeEnum;
import com.github.pagehelper.PageInfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;

public interface WxPayLogService {
    PageInfo<WxPayLog> list(PageParam pageParam, SysAdmin admin);

    void add(WxPayLog param, SysAdmin admin);

    void update(WxPayLog param, SysAdmin admin);

    void del(String serviceID, SysAdmin admin);

    WxPayLog detail(String serviceID, SysAdmin admin);

    WxPayLog detail(String serviceID);

    /**
     * 获取微信预支付信息
     *
     * @param userID              用户ID
     * @param amount              支付金额（元）
     * @param wxPayModuleTypeEnum 使用支付模块
     * @param eventId             事件关联ID
     * @return
     */
    WxPayLog prepay(Integer userID, BigDecimal amount, WxPayModuleTypeEnum wxPayModuleTypeEnum, Integer eventId, HttpServletRequest request);

    /**
     * 微信付款成功或失败回调接口
     *
     * @param request
     * @param response
     * @return
     */
    Object payNotify(HttpServletRequest request, HttpServletResponse response);
}
